<!--Copyright (C) 1988-2005 by the Institute of Global Environment and Society (IGES). See file COPYRIGHT for more information.-->

<h2>ncgen</h2>
<code>ncgen [-b] [-c] [-f] [-n] [-o <i>output_file</i>]
<i>input_file</i></code><p>
Where:<p>
<ul>
<code>-b</code>   Create a (binary) netCDF file.  If the <code>-o</code> 
option is absent,  a default file name will be constructed from the
          netCDF name (specified after the netcdf keyword in  the
          input) by appending the <code>.nc</code> extension.  If a file
already exists  with  the  specified  name,  it  will  be
          overwritten.<p>

<code>-c</code>   Generate C source code that will create a  netCDF
file
          matching  the  netCDF specification.  The C source code
          is written to standard output.<p>
<code>-f</code>   Generate Fortran source code that will create a
netCDF
          file  matching  the  netCDF specification.  The Fortran
          source code is written to standard output.     <p>
<code>-o
<i>outputfile</i></code><br>
<ul>
Name for the netCDF file created.  If  this  option  is
          specified, it implies the <code>-b</code> option.  (This
option is
          necessary  because  netCDF  files  cannot  be   written
          directly  to  standard output, since standard output is
          not seekable.)</ul><p>

<code>-n</code>   Like <code>-b</code> option, except creates netCDF
file with the obsolete <code>.cdf</code> extension instead of the
<code>.nc</code> extension,
          in the absence of an output filename specified  by  the
          <code>-O</code>  option.  This option is only supported for
backward
          compatibility.</ul></ul><p>
<h3>Examples</h3>
<ol>
<li>Check the syntax of the CDL file <code>foo.cdl</code>:<p>
<dd><code>ncgen foo.cdl</code><p>
<li>
From the CDL file <code>foo.cdl</code>, generate an  equivalent  binary
     netCDF file named <code>x.nc</code>:<p>
<dd><code>ncgen -o x.nc foo.cdl</code><p>
<li>
From the CDL file <code>foo.cdl</code>, generate a C program containing
     the  netCDF  function  invocations  necessary  to  create an
     equivalent binary netCDF file named <code>x.nc</code>:<p>
<dd><code>ncgen -c -o x.nc foo.cdl</code></ol>
